﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InnovTech.Data.Behavior
{
    /// <summary>
    /// The base class of a behavior
    /// </summary>
    /// <typeparam name="TTarget"></typeparam>
    /// <typeparam name="TParameter"></typeparam>
    public abstract class BehaviorBase<TTarget, TParameter> : IBehavior<TTarget, TParameter>
    {

        protected TTarget _target;

        public BehaviorBase(TTarget target)
        {
            _target = target;
        }

        /// <summary>
        /// Gets the target object
        /// </summary>
        public TTarget Target
        {
            get { return _target; }
        }

        /// <summary>
        /// Executes the logic of this behavior.
        /// </summary>
        /// <param name="parameter"></param>
        public abstract void Execute(TParameter parameter);
    }
}
